Fixes #19
authorjustbur <justin@burkett.cc>
Wed, 8 Jul 2015 15:41:10 +0000 (11:41 -0400)
committerjustbur <justin@burkett.cc>
Wed, 8 Jul 2015 15:41:10 +0000 (11:41 -0400)
Kind of a hack, but seems a lot easier than trying to get an exact
calculation of the width

which-key.el

index 252aa2bda7570da41fa6a33d591c7621a1c768c5..a908c7c6ca71a409795e1730ad74966d6c668661 100644 (file)
@@ -241,7 +241,9 @@ need to start the closing timer."
     ;; side defaults to bottom
     (if (get-buffer-window which-key--buffer)
         (display-buffer-reuse-window which-key--buffer alist)
-      (display-buffer-in-major-side-window which-key--buffer side 0 alist))))
+      (display-buffer-in-major-side-window which-key--buffer side 0 alist))
+    (let ((fit-window-to-buffer-horizontally t))
+      (fit-window-to-buffer (get-buffer-window which-key--buffer)))))
 
 (defun which-key/show-buffer-frame (act-popup-dim)
   (let* ((orig-window (selected-window))